//
//  WXFirstViewController.m
//  PodsLibDemo
//
//  Created by wangxiang on 2020/7/16.
//  Copyright © 2020 wangxiang. All rights reserved.
//

#import "WXFirstViewController.h"
#import "WXLPodsLibResource.h"
#import "WXSecondViewController.h"

@interface WXFirstViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *imageView;

@end

///PS：因为xib和图片等属于资源文件，不能放在源文件中(Classes)，需要放在Assets中
@implementation WXFirstViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"First vc";
    self.view.backgroundColor = [UIColor redColor];
    
    NSLog(@"进入 WXFirstViewController");
    
    UIImage *image = [UIImage imageNamed:@"LuLian2"];

    NSLog(@"WXFirstViewController LuLian2-image  = %@",image);

    UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
    imageView.frame = CGRectMake(200, 70, 90, 90);
    [self.view addSubview:imageView];
    
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setTitle:@"跳转到SecondVC页面" forState:UIControlStateNormal];
    [btn setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(gotoSecondVCButtonClicked) forControlEvents:UIControlEventTouchUpInside];
    btn.frame = CGRectMake(100, 400, 200, 40);
    [self.view addSubview:btn];
    
}


- (IBAction)addImage:(id)sender {
    
    UIImage *image = [UIImage imageNamed:@"success" inBundle:[WXLPodsLibResource SDKBundle] compatibleWithTraitCollection:nil];
    
    NSLog(@"WXFirstViewController success-image  = %@",image);
    
    self.imageView.image = image;
}


- (void)gotoSecondVCButtonClicked{
    WXSecondViewController *vc = [[WXSecondViewController alloc] init];
    
    [self.navigationController pushViewController:vc animated:YES];
}
@end
